|
Technote 1175Applet Signing with MRJ and JavakeyBy Levi Brown |
CONTENTSOverview |
Applet signing has been the topic of considerable discussion throughout the Java community. Processes and procedures related to the signing of applets are generally complex and sometimes confusing, and users have had issues related to using and signing applets with MRJ. The purpose of this document is to discuss the technology being employed and to clarify the procedures needed to sign jar files, install certificates, and successfully utilize a signed applet. |
How To Sign an Applet with JavakeyGetting Started
Creating the Certification Directive File You provide certification information to javakey by using a directive file, which is basically a property file that javakey reads when signing a jar file. Use SimpleText to create a file for our certificate directive information. In this case, we will call it “cert.directive”. The contents of the file should look like this: Explanation of Properties:
Creating the Signature Directive File To sign a file, you must provide javakey with several pieces of information: The username of the key pair to use, the number of the certificate to use, the name to be used for the generated signature and signature block files, and the name of the signed jar file to be output. Again, we will provide information to javakey by using another directive file. Use SimpleText to create a file for this signature directive information. In this case we will call it “sign.directive”. The contents of the file should look like this: Explanation of Properties:
|
How to Install and Use a Signed AppletUnder MRJ 2.1.x, you will need to follow the following procedure to install the certificate on to the client machine, while MRJ 2.2 gives you another option.
Because MRJ 2.2 enhances support for signed applets, the above steps are not necessary under MRJ 2.2. If the user access a signed applet and the certificate is already in their Java security database, the applet will run without restrictions. If the certificate is not in their Java security database, a dialog box will provide information about the certificate: The user can then choose to (1) accept the certificate permanently, thereby adding it to their Java security database, or (2) to run this applet now but not add the certificate to the database, or (3) to reject the certificate. If the user chooses to reject the certificate, the applet will still run, but will generate Java security exceptions if it tries to perform a restricted action. |
Thanks to Jens Alfke, Michael Hopkins, Shehryar Lasi, Subra Mayilvahanan, and Andrew Roughan.